package cn.example.demo.modules.house.dto;

import cn.example.demo.common.retrieval.BaseRequest;
import cn.example.demo.common.validation.groups.*;
import cn.example.demo.common.validation.sequence.HousingOrderSequenceProvider;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sun.xml.bind.v2.TODO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.group.GroupSequenceProvider;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * 描述：【租房订单】DTO
 */
@GroupSequenceProvider(HousingOrderSequenceProvider.class)
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HousingOrderDto extends BaseRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "ID不能为空！", groups = {Update.class, Identity.class})
    private String id;

    @NotEmpty(message = "房源ID不能为空！", groups = {Insert.class, Update.class})
    private String houseId;

    private Integer houseOwner;

    // TODO-lzx 分组级联校验（根据其他字段决定是否校验）
    @NotBlank(message = "若需要餐饮时，请在餐饮列表任选一项！", groups = {Cascade.class})
    private String mealId;

    @NotEmpty(message = "是否需要餐饮不能为空！", groups = {Insert.class, Update.class})
    private String isNeedMeal;

    @NotNull(message = "预定入住日期不能为空！", groups = {Insert.class, Update.class})
    private Date orderStartTime;

    @NotNull(message = "预定退房日期不能为空！", groups = {Insert.class, Update.class})
    private Date orderEndTime;

    private BigDecimal houseCost;

    private Integer starMark;

    private String appraise;

    private String reply;

    @NotNull(message = "订单状态不能为空！", groups = {Update.class, Batch.class})
    private Integer orderStatus;

    private Integer organizationId;
    private Integer createUser;
    private String createUserName;
    private Date createTime;
    private Integer updateUser;
    private String updateUserName;
    private Date updateTime;

    private Date orderStartTimeStart;
    private Date orderStartTimeEnd;
    private Date orderEndTimeStart;
    private Date orderEndTimeEnd;
    private Date createTimeStart;
    private Date createTimeEnd;
    private Date updateTimeStart;
    private Date updateTimeEnd;

    @NotEmpty(message = "IDs不能为空集！", groups = {Delete.class, Batch.class})
    private List<String> ids;

    private Date prePayDate;
}
